<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181024_091203_ADD_FIELD_PRODUCT
 */
class m181024_091203_ADD_FIELD_PRODUCT extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        
        $this->dropColumn('{{product}}', 'file_path');

        $this->addColumn('{{product}}', 'remark', Schema::TYPE_STRING. "(1024) NULL COMMENT '备注' AFTER cost_price ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181024_091203_ADD_FIELD_PRODUCT cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181024_091203_ADD_FIELD_PRODUCT cannot be reverted.\n";

        return false;
    }
    */
}
